<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../common.jsp" %>
<script type="text/javascript" src="${ctx}/static/js/role.js"></script>

<div id="dg_role_toolbar">
    <div style="padding: 10px;">
        <form id="searRoleParams">
            <label for="role.id">ID:</label><input class="easyui-validatebox" type="number" name="role.id"/>
            <label for="role.name">角色名称:</label><input class="easyui-validatebox" type="text" name="role.name"/>
            <label for="role.gmlevel">权限等级:</label><input class="easyui-validatebox" type="text" name="role.gmlevel"/>
            <label for="role.position">职位:</label><select class="easyui-validatebox" name="role.position"><option>全部</option>
                                                            <option>经理</option>
                                                            <option>助理</option>
                                                            <option>组长</option>
                                                            <option>员工</option>
                                                       </select>
        </form>
    </div>
    <span onclick="searchRole()" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</span>
    <span onclick="addRole()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</span>
    <span onclick="updateRole()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</span>
    <span onclick="removeRole()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</span>
</div>

<div class="easyui-layout" fit="true">
    <div data-options="region:'center',split:true" title="角色列表" style="width:80%;position: static;">
         <table class="easyui-datagrid" id="dg_role"
                data-options="url:'${ctx}/sys/role_searchPage',fit:true,fitColumns:true,singleSelect:true,pagination:true,pageSize:10,toolbar:'#dg_role_toolbar',onSelect:onSelectDgRole">
             <thead>
             <tr>
                 <th data-options="field:'id',width:100">ID</th>
                 <th data-options="field:'name',width:100">角色名称</th>
                 <th data-options="field:'gmlevel',width:100">权限等级</th>
                 <th data-options="field:'position',width:100">职位</th>
             </tr>
             </thead>
         </table>
    </div>

    <script type="text/javascript" src="${ctx}/static/js/roleLimit.js"></script>
    <div data-options="region:'east',split:true" title="授权菜单" style="width:20%;position: static;">
        <ul id="menu_tree_role" class="easyui-tree">

        </ul>
    </div>

</div>


<div id="dl_role_edit" class="easyui-dialog" closed="true" title="编辑菜单" style="width:400px;height:400px; padding: 10px"
     data-options="resizable:true,modal:true,buttons:'#tb_role_edit'">
    <form id="form_role_edit" method="post">
        <div class="mb10">
            <label for="role.id">ID:</label>
            <input class="easyui-validatebox" type="text" name="role.id" data-options="required:true"/>
        </div>
        <div class="mb10">
            <label for="role.name">角色名称:</label>
            <input class="easyui-validatebox" type="text" name="role.name" data-options="required:true"/>
        </div>
        <div class="mb10">
            <label for="role.gmlevel">权限等级:</label>
            <input class="easyui-validatebox" type="text" name="role.gmlevel" data-options=""/>
        </div>
        <div class="mb10">
            <label for="role.position">职位:</label>
            <input class="easyui-validatebox" type="text" name="role.position" data-options=""/>
        </div>
    </form>
</div>
<div id="tb_role_edit">
    <span onclick="submitRole()" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true">提交</span>
    <span onclick="closeEdit()" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">取消</span>
</div>